{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.511284300Z",
     "start_time": "2024-05-19T12:36:12.797280300Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                     发震时刻  震级(M)  纬度(°)   经度(°)  深度(千米)         参考位置\n0     2024-01-08 03:48:13    3.8  39.40   97.30      12     甘肃酒泉市肃北县\n1     2024-01-06 19:46:30    5.5   3.00   65.70      10      卡尔斯伯格海岭\n2     2024-01-05 01:37:20    3.7  41.16   83.72      15   新疆阿克苏地区库车市\n3     2024-01-04 22:29:20    4.2  21.05  109.24       9   广西北海市银海区海域\n4     2024-01-04 12:56:36    5.7 -20.90 -176.15     210         斐济群岛\n...                   ...    ...    ...     ...     ...          ...\n1012  2023-01-02 16:14:28    3.3  36.13   78.41     107    新疆和田地区皮山县\n1013  2023-01-02 02:35:07    5.2  40.42 -123.95      30     美国加利福尼亚州\n1014  2023-01-02 02:24:29    5.1  -2.70  140.80      20       印尼巴布亚省\n1015  2023-01-01 21:02:58    4.2  36.77   77.08     101    新疆喀什地区叶城县\n1016  2023-01-01 17:20:07    3.0  38.87   75.86      37  新疆克孜勒苏州阿克陶县\n\n[1017 rows x 6 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>发震时刻</th>\n      <th>震级(M)</th>\n      <th>纬度(°)</th>\n      <th>经度(°)</th>\n      <th>深度(千米)</th>\n      <th>参考位置</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2024-01-08 03:48:13</td>\n      <td>3.8</td>\n      <td>39.40</td>\n      <td>97.30</td>\n      <td>12</td>\n      <td>甘肃酒泉市肃北县</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2024-01-06 19:46:30</td>\n      <td>5.5</td>\n      <td>3.00</td>\n      <td>65.70</td>\n      <td>10</td>\n      <td>卡尔斯伯格海岭</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>2024-01-05 01:37:20</td>\n      <td>3.7</td>\n      <td>41.16</td>\n      <td>83.72</td>\n      <td>15</td>\n      <td>新疆阿克苏地区库车市</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>2024-01-04 22:29:20</td>\n      <td>4.2</td>\n      <td>21.05</td>\n      <td>109.24</td>\n      <td>9</td>\n      <td>广西北海市银海区海域</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>2024-01-04 12:56:36</td>\n      <td>5.7</td>\n      <td>-20.90</td>\n      <td>-176.15</td>\n      <td>210</td>\n      <td>斐济群岛</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1012</th>\n      <td>2023-01-02 16:14:28</td>\n      <td>3.3</td>\n      <td>36.13</td>\n      <td>78.41</td>\n      <td>107</td>\n      <td>新疆和田地区皮山县</td>\n    </tr>\n    <tr>\n      <th>1013</th>\n      <td>2023-01-02 02:35:07</td>\n      <td>5.2</td>\n      <td>40.42</td>\n      <td>-123.95</td>\n      <td>30</td>\n      <td>美国加利福尼亚州</td>\n    </tr>\n    <tr>\n      <th>1014</th>\n      <td>2023-01-02 02:24:29</td>\n      <td>5.1</td>\n      <td>-2.70</td>\n      <td>140.80</td>\n      <td>20</td>\n      <td>印尼巴布亚省</td>\n    </tr>\n    <tr>\n      <th>1015</th>\n      <td>2023-01-01 21:02:58</td>\n      <td>4.2</td>\n      <td>36.77</td>\n      <td>77.08</td>\n      <td>101</td>\n      <td>新疆喀什地区叶城县</td>\n    </tr>\n    <tr>\n      <th>1016</th>\n      <td>2023-01-01 17:20:07</td>\n      <td>3.0</td>\n      <td>38.87</td>\n      <td>75.86</td>\n      <td>37</td>\n      <td>新疆克孜勒苏州阿克陶县</td>\n    </tr>\n  </tbody>\n</table>\n<p>1017 rows × 6 columns</p>\n</div>"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df = pd.read_excel('../static/data/2023地震数据.xlsx')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "                     发震时刻  震级(M)  纬度(°)   经度(°)  深度(千米)         参考位置  year  \\\n0     2024-01-08 03:48:13    3.8  39.40   97.30      12     甘肃酒泉市肃北县  2024   \n1     2024-01-06 19:46:30    5.5   3.00   65.70      10      卡尔斯伯格海岭  2024   \n2     2024-01-05 01:37:20    3.7  41.16   83.72      15   新疆阿克苏地区库车市  2024   \n3     2024-01-04 22:29:20    4.2  21.05  109.24       9   广西北海市银海区海域  2024   \n4     2024-01-04 12:56:36    5.7 -20.90 -176.15     210         斐济群岛  2024   \n...                   ...    ...    ...     ...     ...          ...   ...   \n1012  2023-01-02 16:14:28    3.3  36.13   78.41     107    新疆和田地区皮山县  2023   \n1013  2023-01-02 02:35:07    5.2  40.42 -123.95      30     美国加利福尼亚州  2023   \n1014  2023-01-02 02:24:29    5.1  -2.70  140.80      20       印尼巴布亚省  2023   \n1015  2023-01-01 21:02:58    4.2  36.77   77.08     101    新疆喀什地区叶城县  2023   \n1016  2023-01-01 17:20:07    3.0  38.87   75.86      37  新疆克孜勒苏州阿克陶县  2023   \n\n      month  \n0         1  \n1         1  \n2         1  \n3         1  \n4         1  \n...     ...  \n1012      1  \n1013      1  \n1014      1  \n1015      1  \n1016      1  \n\n[1017 rows x 8 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>发震时刻</th>\n      <th>震级(M)</th>\n      <th>纬度(°)</th>\n      <th>经度(°)</th>\n      <th>深度(千米)</th>\n      <th>参考位置</th>\n      <th>year</th>\n      <th>month</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2024-01-08 03:48:13</td>\n      <td>3.8</td>\n      <td>39.40</td>\n      <td>97.30</td>\n      <td>12</td>\n      <td>甘肃酒泉市肃北县</td>\n      <td>2024</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2024-01-06 19:46:30</td>\n      <td>5.5</td>\n      <td>3.00</td>\n      <td>65.70</td>\n      <td>10</td>\n      <td>卡尔斯伯格海岭</td>\n      <td>2024</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>2024-01-05 01:37:20</td>\n      <td>3.7</td>\n      <td>41.16</td>\n      <td>83.72</td>\n      <td>15</td>\n      <td>新疆阿克苏地区库车市</td>\n      <td>2024</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>2024-01-04 22:29:20</td>\n      <td>4.2</td>\n      <td>21.05</td>\n      <td>109.24</td>\n      <td>9</td>\n      <td>广西北海市银海区海域</td>\n      <td>2024</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>2024-01-04 12:56:36</td>\n      <td>5.7</td>\n      <td>-20.90</td>\n      <td>-176.15</td>\n      <td>210</td>\n      <td>斐济群岛</td>\n      <td>2024</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1012</th>\n      <td>2023-01-02 16:14:28</td>\n      <td>3.3</td>\n      <td>36.13</td>\n      <td>78.41</td>\n      <td>107</td>\n      <td>新疆和田地区皮山县</td>\n      <td>2023</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1013</th>\n      <td>2023-01-02 02:35:07</td>\n      <td>5.2</td>\n      <td>40.42</td>\n      <td>-123.95</td>\n      <td>30</td>\n      <td>美国加利福尼亚州</td>\n      <td>2023</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1014</th>\n      <td>2023-01-02 02:24:29</td>\n      <td>5.1</td>\n      <td>-2.70</td>\n      <td>140.80</td>\n      <td>20</td>\n      <td>印尼巴布亚省</td>\n      <td>2023</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1015</th>\n      <td>2023-01-01 21:02:58</td>\n      <td>4.2</td>\n      <td>36.77</td>\n      <td>77.08</td>\n      <td>101</td>\n      <td>新疆喀什地区叶城县</td>\n      <td>2023</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1016</th>\n      <td>2023-01-01 17:20:07</td>\n      <td>3.0</td>\n      <td>38.87</td>\n      <td>75.86</td>\n      <td>37</td>\n      <td>新疆克孜勒苏州阿克陶县</td>\n      <td>2023</td>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>1017 rows × 8 columns</p>\n</div>"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['year'] = df['发震时刻'].apply(lambda x:int(x.split('-')[0]))\n",
    "df['month'] = df['发震时刻'].apply(lambda x:int(x.split('-')[1]))\n",
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.527470900Z",
     "start_time": "2024-05-19T12:36:13.508779400Z"
    }
   },
   "id": "f9cc5328f53e642a"
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "{'name': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n 'value': [[3.8,\n   5.5,\n   3.7,\n   4.2,\n   5.7,\n   2.4,\n   3.5,\n   5.5,\n   7.4,\n   2.9,\n   3.0,\n   3.1,\n   4.8,\n   3.2,\n   2.6,\n   6.1,\n   3.6,\n   5.3,\n   5.9,\n   3.1,\n   3.0,\n   3.8,\n   3.2,\n   2.1,\n   3.3,\n   3.1,\n   3.0,\n   6.0,\n   3.2,\n   3.0,\n   4.4,\n   3.2,\n   3.2,\n   3.2,\n   3.3,\n   4.0,\n   3.6,\n   3.1,\n   3.2,\n   2.9,\n   4.5,\n   5.6,\n   3.8,\n   3.0,\n   4.9,\n   3.4,\n   3.9,\n   5.8,\n   3.0,\n   6.3,\n   5.0,\n   2.1,\n   2.5,\n   5.5,\n   2.4,\n   3.2,\n   3.3,\n   6.6,\n   3.1,\n   6.2,\n   3.2,\n   3.0,\n   3.0,\n   5.4,\n   3.3,\n   5.6,\n   7.0,\n   6.1,\n   3.6,\n   3.2,\n   3.1,\n   3.4,\n   3.9,\n   5.8,\n   6.0,\n   3.0,\n   3.8,\n   5.5,\n   3.0,\n   4.3,\n   3.0,\n   3.0,\n   3.4,\n   5.4,\n   3.0,\n   2.9,\n   5.8,\n   3.0,\n   3.0,\n   3.4,\n   5.8,\n   7.6,\n   3.4,\n   3.1,\n   7.0,\n   4.0,\n   5.9,\n   3.1,\n   6.0,\n   3.7,\n   4.2,\n   3.8,\n   3.2,\n   3.2,\n   5.4,\n   3.2,\n   3.3,\n   5.2,\n   5.1,\n   4.2,\n   3.0],\n  [4.6,\n   3.8,\n   5.0,\n   5.6,\n   5.4,\n   5.1,\n   4.5,\n   2.2,\n   3.1,\n   6.3,\n   4.1,\n   6.0,\n   5.3,\n   3.5,\n   3.0,\n   3.1,\n   3.0,\n   6.3,\n   3.0,\n   5.1,\n   3.3,\n   4.5,\n   4.5,\n   4.6,\n   4.6,\n   4.8,\n   4.5,\n   4.8,\n   7.2,\n   3.6,\n   4.6,\n   5.4,\n   3.4,\n   5.0,\n   5.6,\n   6.3,\n   3.1,\n   3.4,\n   4.1,\n   2.8,\n   6.2,\n   5.6,\n   6.1,\n   5.7,\n   5.6,\n   3.0,\n   3.6,\n   4.3,\n   3.6,\n   6.1,\n   3.1,\n   2.8,\n   3.2,\n   3.3,\n   2.9,\n   3.0,\n   4.2,\n   3.1,\n   5.8,\n   2.9,\n   2.8,\n   4.3,\n   3.0,\n   3.0,\n   3.0,\n   5.1,\n   4.7,\n   5.2,\n   3.2,\n   3.4,\n   4.3,\n   5.9,\n   7.8,\n   6.7,\n   7.8,\n   3.0,\n   3.2,\n   5.5,\n   5.8,\n   3.8,\n   5.9,\n   3.1,\n   3.4,\n   3.2,\n   4.2,\n   4.9,\n   3.1,\n   2.8,\n   3.7,\n   6.0,\n   3.3,\n   3.0],\n  [3.4,\n   3.4,\n   3.6,\n   2.2,\n   6.2,\n   3.4,\n   3.1,\n   3.4,\n   2.3,\n   6.1,\n   3.8,\n   6.1,\n   3.7,\n   3.1,\n   5.7,\n   3.1,\n   3.2,\n   3.3,\n   5.6,\n   3.7,\n   5.5,\n   3.3,\n   2.5,\n   4.2,\n   5.0,\n   3.3,\n   3.2,\n   5.7,\n   5.2,\n   5.9,\n   6.4,\n   5.3,\n   6.9,\n   2.1,\n   4.9,\n   3.0,\n   3.1,\n   2.1,\n   6.7,\n   4.2,\n   3.0,\n   4.8,\n   3.2,\n   7.0,\n   3.3,\n   2.0,\n   3.3,\n   3.6,\n   4.6,\n   3.1,\n   6.5,\n   5.3,\n   3.4,\n   3.4,\n   3.7,\n   3.6,\n   3.3,\n   3.8,\n   3.2,\n   3.1,\n   3.2,\n   5.7,\n   2.5,\n   5.5,\n   5.8,\n   5.7,\n   3.4,\n   4.5,\n   5.9,\n   5.9,\n   5.8,\n   3.0,\n   3.3,\n   6.8,\n   3.0,\n   3.3,\n   4.1,\n   6.4,\n   4.1,\n   3.3,\n   3.1,\n   3.3,\n   5.7,\n   5.2,\n   3.2,\n   6.6,\n   3.7,\n   3.3],\n  [5.7,\n   5.6,\n   6.5,\n   3.3,\n   5.7,\n   3.5,\n   3.1,\n   3.2,\n   3.3,\n   4.8,\n   6.9,\n   3.3,\n   7.2,\n   3.2,\n   3.8,\n   5.8,\n   5.8,\n   5.2,\n   6.3,\n   4.7,\n   5.9,\n   3.2,\n   6.2,\n   3.1,\n   5.0,\n   3.3,\n   6.6,\n   5.6,\n   3.3,\n   3.0,\n   3.6,\n   3.1,\n   5.7,\n   5.8,\n   3.2,\n   5.3,\n   5.7,\n   7.1,\n   3.6,\n   3.4,\n   6.1,\n   3.0,\n   5.3,\n   5.6,\n   5.5,\n   3.2,\n   3.4,\n   3.1,\n   4.6,\n   4.0,\n   3.2,\n   5.8,\n   4.0,\n   3.2,\n   3.6,\n   2.9,\n   6.4,\n   3.2,\n   5.8,\n   6.2,\n   5.1,\n   3.4,\n   6.0,\n   6.5,\n   6.1,\n   7.1,\n   3.0,\n   3.0,\n   5.1,\n   3.3,\n   4.0,\n   3.2,\n   3.1,\n   3.0,\n   3.6],\n  [5.7,\n   3.4,\n   4.0,\n   3.4,\n   5.6,\n   3.7,\n   3.0,\n   3.0,\n   3.9,\n   3.7,\n   5.2,\n   4.1,\n   5.3,\n   5.6,\n   3.6,\n   5.9,\n   3.0,\n   3.1,\n   6.2,\n   3.8,\n   4.8,\n   3.0,\n   3.0,\n   3.9,\n   6.5,\n   6.1,\n   3.2,\n   3.4,\n   4.3,\n   3.0,\n   6.1,\n   3.1,\n   3.1,\n   3.3,\n   3.2,\n   3.0,\n   5.3,\n   5.0,\n   3.0,\n   3.3,\n   5.3,\n   4.5,\n   6.0,\n   6.9,\n   2.8,\n   7.2,\n   2.9,\n   5.7,\n   3.2,\n   5.3,\n   7.7,\n   3.9,\n   6.4,\n   4.5,\n   3.0,\n   5.4,\n   5.1,\n   5.5,\n   3.0,\n   5.3,\n   5.5,\n   4.0,\n   3.0,\n   4.2,\n   4.5,\n   5.9,\n   7.5,\n   3.6,\n   3.3,\n   3.1,\n   3.1,\n   2.3,\n   3.0,\n   3.3,\n   3.0,\n   3.7,\n   3.1,\n   5.4,\n   5.7,\n   4.3,\n   6.3,\n   3.1,\n   3.2,\n   3.4,\n   4.5,\n   2.1,\n   3.0,\n   3.3,\n   3.3,\n   4.9,\n   5.3,\n   4.5,\n   4.0,\n   3.7,\n   5.7,\n   3.2,\n   4.4,\n   5.2,\n   3.1,\n   3.3,\n   5.8],\n  [5.9,\n   3.7,\n   3.1,\n   5.0,\n   4.0,\n   5.9,\n   6.0,\n   3.3,\n   3.0,\n   5.0,\n   5.6,\n   3.0,\n   3.3,\n   5.4,\n   6.1,\n   3.7,\n   5.5,\n   5.9,\n   6.4,\n   3.0,\n   3.9,\n   3.3,\n   3.7,\n   3.8,\n   4.4,\n   5.6,\n   5.9,\n   5.3,\n   3.1,\n   6.2,\n   5.8,\n   7.2,\n   3.2,\n   3.7,\n   3.6,\n   6.2,\n   2.2,\n   3.0,\n   4.1,\n   5.2,\n   3.6,\n   3.7,\n   3.3,\n   5.6,\n   4.3,\n   3.6,\n   6.2,\n   3.8,\n   3.3,\n   4.2,\n   4.7,\n   3.2,\n   3.1,\n   5.7,\n   3.1,\n   3.2,\n   2.9,\n   3.8,\n   5.3,\n   5.9,\n   5.3,\n   3.6],\n  [2.8,\n   3.1,\n   2.9,\n   3.7,\n   4.2,\n   5.7,\n   3.7,\n   5.9,\n   5.8,\n   3.4,\n   4.2,\n   3.1,\n   6.4,\n   5.5,\n   5.3,\n   5.4,\n   6.0,\n   3.0,\n   3.7,\n   3.2,\n   3.3,\n   3.2,\n   6.6,\n   3.1,\n   3.1,\n   3.0,\n   3.2,\n   5.4,\n   6.7,\n   7.2,\n   3.0,\n   3.7,\n   3.4,\n   6.2,\n   3.4,\n   4.2,\n   6.6,\n   4.1,\n   5.6,\n   3.4,\n   4.7,\n   5.4,\n   3.1,\n   3.0,\n   2.9,\n   4.1,\n   5.9,\n   3.4,\n   4.3,\n   3.8,\n   5.4,\n   3.1,\n   3.7,\n   5.3,\n   3.4,\n   6.9,\n   3.3,\n   3.4,\n   3.3,\n   3.0,\n   5.0,\n   5.8,\n   3.7,\n   3.1],\n  [3.3,\n   3.2,\n   3.1,\n   3.0,\n   3.9,\n   4.6,\n   2.3,\n   3.1,\n   5.5,\n   5.9,\n   3.7,\n   5.9,\n   7.1,\n   5.3,\n   3.0,\n   3.0,\n   3.9,\n   3.5,\n   5.8,\n   2.8,\n   3.2,\n   6.1,\n   2.8,\n   4.6,\n   3.0,\n   4.1,\n   3.1,\n   5.9,\n   4.3,\n   3.0,\n   3.5,\n   4.3,\n   4.2,\n   3.2,\n   3.3,\n   5.3,\n   4.0,\n   3.4,\n   3.4,\n   6.2,\n   6.4,\n   2.9,\n   5.0,\n   6.1,\n   4.4,\n   5.4,\n   3.6,\n   3.0,\n   3.1,\n   6.0,\n   5.1,\n   3.4,\n   5.2,\n   3.2,\n   3.6,\n   5.8,\n   5.9,\n   5.1,\n   3.0,\n   6.2,\n   3.2,\n   5.9,\n   3.0,\n   5.5,\n   5.9,\n   6.1,\n   3.1,\n   3.1,\n   5.7,\n   4.2,\n   5.6,\n   5.6,\n   3.2,\n   5.9,\n   3.0,\n   5.7,\n   5.5,\n   5.3,\n   3.0,\n   4.4],\n  [3.3,\n   3.0,\n   5.8,\n   3.1,\n   3.1,\n   6.0,\n   3.0,\n   3.2,\n   3.6,\n   3.4,\n   5.7,\n   3.1,\n   6.0,\n   3.7,\n   3.1,\n   5.8,\n   3.2,\n   5.4,\n   6.4,\n   3.4,\n   3.0,\n   2.9,\n   3.1,\n   5.5,\n   6.1,\n   3.0,\n   6.3,\n   2.3,\n   6.1,\n   2.9,\n   3.1,\n   3.4,\n   3.0,\n   3.2,\n   3.4,\n   5.9,\n   6.9,\n   3.7,\n   4.3,\n   6.1,\n   6.5,\n   3.9,\n   6.4,\n   3.1,\n   3.1,\n   3.6,\n   2.5,\n   5.7,\n   4.9,\n   5.4,\n   3.3,\n   3.9,\n   3.9,\n   3.2,\n   3.4,\n   3.3,\n   3.3,\n   6.1,\n   3.3,\n   3.6,\n   3.0,\n   2.7],\n  [6.7,\n   3.7,\n   6.5,\n   2.6,\n   4.1,\n   3.9,\n   3.6,\n   3.8,\n   3.0,\n   3.1,\n   3.2,\n   3.1,\n   3.2,\n   6.2,\n   3.0,\n   3.2,\n   5.4,\n   3.0,\n   3.9,\n   3.2,\n   2.9,\n   3.7,\n   5.4,\n   5.4,\n   3.3,\n   5.8,\n   5.5,\n   3.0,\n   4.1,\n   3.7,\n   3.0,\n   3.1,\n   3.0,\n   4.0,\n   3.1,\n   3.3,\n   4.0,\n   3.1,\n   3.6,\n   3.1,\n   5.5,\n   3.3,\n   4.4,\n   5.9,\n   3.2,\n   4.0,\n   5.8,\n   4.4,\n   4.7,\n   3.2,\n   5.0,\n   4.7,\n   5.0,\n   3.0,\n   3.0,\n   3.3,\n   3.1,\n   3.0,\n   3.1,\n   5.8,\n   3.1,\n   5.9,\n   3.7,\n   3.1,\n   3.0,\n   5.3,\n   3.0,\n   5.5,\n   5.3,\n   3.4,\n   6.4,\n   5.5,\n   3.0,\n   2.8,\n   5.2,\n   3.2,\n   6.4,\n   3.4,\n   3.3,\n   4.2,\n   4.9,\n   5.6,\n   5.8,\n   2.3,\n   3.0,\n   6.3,\n   5.4,\n   6.3,\n   3.3,\n   6.0,\n   5.6,\n   5.1,\n   3.6,\n   5.9,\n   4.5,\n   3.0,\n   3.0,\n   5.6,\n   3.2,\n   3.3,\n   5.6,\n   5.7,\n   6.7,\n   6.8,\n   5.8,\n   6.2,\n   6.2,\n   4.3,\n   4.3,\n   5.9,\n   3.1,\n   5.5,\n   6.2,\n   3.2,\n   6.4,\n   5.3,\n   5.4,\n   6.0,\n   5.5,\n   3.6,\n   5.7,\n   3.4,\n   5.0,\n   5.0,\n   3.6,\n   3.3,\n   4.2,\n   4.4],\n  [3.2,\n   4.1,\n   5.8,\n   3.7,\n   3.0,\n   3.0,\n   3.4,\n   3.7,\n   6.6,\n   3.0,\n   3.0,\n   4.8,\n   4.2,\n   3.1,\n   3.9,\n   6.9,\n   4.0,\n   4.0,\n   6.9,\n   6.1,\n   3.3,\n   5.9,\n   5.9,\n   3.3,\n   3.4,\n   6.8,\n   5.9,\n   3.6,\n   5.8,\n   3.6,\n   4.0,\n   5.9,\n   5.7,\n   3.4,\n   5.6,\n   5.3,\n   5.7,\n   3.6,\n   5.8,\n   3.0,\n   5.9,\n   4.7,\n   5.8,\n   5.7,\n   5.5,\n   3.3,\n   6.7,\n   3.1,\n   5.4,\n   7.1,\n   3.1,\n   3.2,\n   3.3,\n   4.3,\n   3.6,\n   4.3,\n   5.4,\n   3.0,\n   3.1,\n   5.6,\n   3.1,\n   4.3,\n   5.9,\n   5.3,\n   6.1],\n  [4.9,\n   3.2,\n   6.3,\n   5.5,\n   3.0,\n   3.1,\n   5.0,\n   5.6,\n   3.2,\n   6.5,\n   3.0,\n   3.1,\n   3.3,\n   3.3,\n   3.1,\n   3.0,\n   3.1,\n   3.3,\n   2.8,\n   5.7,\n   5.6,\n   3.3,\n   3.4,\n   3.1,\n   3.0,\n   6.2,\n   3.1,\n   4.1,\n   6.2,\n   3.4,\n   3.1,\n   5.5,\n   3.2,\n   3.2,\n   3.2,\n   4.1,\n   3.1,\n   3.4,\n   3.4,\n   4.0,\n   3.9,\n   6.2,\n   3.1,\n   5.6,\n   3.0,\n   3.6,\n   2.3,\n   3.8,\n   3.0,\n   3.3,\n   3.1,\n   3.0,\n   5.8,\n   3.0,\n   6.1,\n   4.4,\n   5.6,\n   3.0,\n   5.5,\n   5.3,\n   3.8,\n   7.1,\n   5.2,\n   3.3,\n   3.0,\n   5.8,\n   5.6,\n   5.7,\n   5.5,\n   3.6,\n   6.9,\n   5.9,\n   6.6,\n   3.0,\n   5.9,\n   6.2,\n   6.0,\n   6.1,\n   7.6,\n   5.8,\n   4.0,\n   3.6,\n   3.0,\n   5.0,\n   3.0,\n   3.2,\n   5.0,\n   3.3,\n   3.8]]}"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "month_group = df[['month', '震级(M)']].groupby('month')\n",
    "name = [int(i[0]) for i in month_group]\n",
    "value = [[float(j[1]) for j in i[1].values] for i in month_group]\n",
    "{\n",
    "    'name': name,\n",
    "    'value': value\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.651883Z",
     "start_time": "2024-05-19T12:36:13.527470900Z"
    }
   },
   "id": "cc56f3d2aa195586"
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "{'name': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n 'value': [111, 92, 88, 75, 101, 62, 64, 80, 62, 128, 65, 89]}"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_line = df.groupby('month')['参考位置'].count().reset_index()\n",
    "{\n",
    "    'name':[i for i in df_line['month'].values.tolist()],\n",
    "    'value':[int(i) for i in df_line['参考位置'].values.tolist()]\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.653552600Z",
     "start_time": "2024-05-19T12:36:13.559117500Z"
    }
   },
   "id": "17fc075c06221851"
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': 1, 'value': 111},\n  {'name': 2, 'value': 92},\n  {'name': 3, 'value': 88},\n  {'name': 4, 'value': 75},\n  {'name': 5, 'value': 101},\n  {'name': 6, 'value': 62},\n  {'name': 7, 'value': 64},\n  {'name': 8, 'value': 80},\n  {'name': 9, 'value': 62},\n  {'name': 10, 'value': 128},\n  {'name': 11, 'value': 65},\n  {'name': 12, 'value': 89}]}"
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_pie = df.groupby('month')['参考位置'].count().reset_index()\n",
    "{\n",
    "    'data':[{'name':i[0]+'月','value':i[1]} for i in df_line[['month','参考位置']].values.tolist()],\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.671124400Z",
     "start_time": "2024-05-19T12:36:13.570444400Z"
    }
   },
   "id": "699b44c546e3ff59"
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'value': 156, 'name': '0-3震级'},\n  {'value': 746, 'name': '3-6震级'},\n  {'value': 115, 'name': '6-9震级'}]}"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "{\n",
    "    'data':[{'value':len(df[(df['震级(M)'] > (i - 1) * 3) & (df['震级(M)'] <= i * 3)]),'name':f'{(i-1)*3}-{i*3}震级'} for i in range(1,4)]\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.719327400Z",
     "start_time": "2024-05-19T12:36:13.580105700Z"
    }
   },
   "id": "29f4bc629f59e56"
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [
    {
     "data": {
      "text/plain": "{'name': ['土耳其-2023-02-06 18:24:50',\n  '土耳其-2023-02-06 09:17:37',\n  '洛亚蒂群岛-2023-05-19 10:57:02',\n  '菲律宾棉兰老岛附近海域-2023-12-02 22:37:06',\n  '印尼班达海-2023-01-10 01:47:33',\n  '汤加群岛-2023-05-11 00:02:01',\n  '日本本州西岸近海-2024-01-01 15:10:10',\n  '洛亚蒂群岛-2023-05-20 09:50:58',\n  '美国阿拉斯加州以南海域-2023-07-16 14:48:21',\n  '新西兰克马德克群岛-2023-04-24 08:41:56'],\n 'value': [7.8, 7.8, 7.7, 7.6, 7.6, 7.5, 7.4, 7.2, 7.2, 7.2]}"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_bar = df.sort_values('震级(M)',ascending=False).head(10)\n",
    "{\n",
    "    'name':['-'.join(i) for i in df_bar[['参考位置','发震时刻']].values],\n",
    "    'value':[float(i) for i in df_bar['震级(M)'].values]\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.720325Z",
     "start_time": "2024-05-19T12:36:13.591912300Z"
    }
   },
   "id": "c65b473f48ab2f17"
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "data": {
      "text/plain": "{'name': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n 'value': [[12,\n   10,\n   15,\n   9,\n   210,\n   10,\n   13,\n   170,\n   30,\n   16,\n   10,\n   10,\n   10,\n   11,\n   11,\n   50,\n   10,\n   150,\n   10,\n   11,\n   12,\n   10,\n   15,\n   10,\n   22,\n   8,\n   10,\n   130,\n   10,\n   23,\n   14,\n   10,\n   10,\n   8,\n   10,\n   10,\n   11,\n   10,\n   12,\n   9,\n   10,\n   11,\n   10,\n   10,\n   10,\n   21,\n   10,\n   50,\n   9,\n   600,\n   10,\n   10,\n   8,\n   30,\n   12,\n   9,\n   9,\n   600,\n   10,\n   170,\n   10,\n   10,\n   20,\n   150,\n   8,\n   10,\n   40,\n   160,\n   8,\n   8,\n   18,\n   8,\n   8,\n   400,\n   30,\n   10,\n   140,\n   60,\n   11,\n   9,\n   0,\n   9,\n   10,\n   40,\n   10,\n   9,\n   10,\n   8,\n   21,\n   14,\n   120,\n   100,\n   10,\n   10,\n   20,\n   14,\n   500,\n   10,\n   200,\n   10,\n   10,\n   10,\n   9,\n   13,\n   100,\n   10,\n   107,\n   30,\n   20,\n   101,\n   37],\n  [10,\n   10,\n   10,\n   530,\n   50,\n   10,\n   10,\n   10,\n   20,\n   70,\n   12,\n   60,\n   10,\n   10,\n   12,\n   10,\n   10,\n   100,\n   85,\n   200,\n   40,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   30,\n   26,\n   130,\n   25,\n   20,\n   10,\n   10,\n   10,\n   10,\n   23,\n   7,\n   40,\n   30,\n   20,\n   80,\n   10,\n   15,\n   16,\n   10,\n   18,\n   350,\n   12,\n   14,\n   10,\n   11,\n   10,\n   10,\n   29,\n   122,\n   20,\n   11,\n   10,\n   11,\n   85,\n   10,\n   10,\n   10,\n   30,\n   20,\n   15,\n   23,\n   20,\n   20,\n   20,\n   20,\n   20,\n   23,\n   8,\n   50,\n   10,\n   20,\n   120,\n   11,\n   9,\n   10,\n   10,\n   10,\n   10,\n   11,\n   10,\n   20,\n   11,\n   12],\n  [95,\n   9,\n   13,\n   10,\n   10,\n   9,\n   18,\n   8,\n   9,\n   30,\n   92,\n   100,\n   18,\n   10,\n   100,\n   10,\n   20,\n   9,\n   300,\n   10,\n   30,\n   10,\n   18,\n   10,\n   10,\n   10,\n   8,\n   120,\n   10,\n   10,\n   200,\n   20,\n   230,\n   18,\n   10,\n   17,\n   10,\n   10,\n   70,\n   142,\n   10,\n   10,\n   8,\n   10,\n   10,\n   19,\n   10,\n   10,\n   10,\n   9,\n   210,\n   140,\n   10,\n   8,\n   10,\n   10,\n   25,\n   10,\n   11,\n   11,\n   10,\n   10,\n   13,\n   150,\n   60,\n   10,\n   8,\n   10,\n   20,\n   10,\n   520,\n   22,\n   22,\n   200,\n   8,\n   10,\n   10,\n   20,\n   11,\n   10,\n   10,\n   10,\n   110,\n   20,\n   11,\n   600,\n   10,\n   8],\n  [30,\n   580,\n   590,\n   10,\n   120,\n   8,\n   11,\n   15,\n   10,\n   10,\n   10,\n   11,\n   30,\n   8,\n   15,\n   20,\n   20,\n   10,\n   10,\n   10,\n   40,\n   8,\n   50,\n   5,\n   10,\n   10,\n   600,\n   120,\n   15,\n   15,\n   10,\n   20,\n   70,\n   10,\n   10,\n   70,\n   600,\n   600,\n   18,\n   17,\n   10,\n   15,\n   10,\n   20,\n   20,\n   8,\n   15,\n   15,\n   15,\n   10,\n   10,\n   100,\n   11,\n   10,\n   20,\n   12,\n   10,\n   10,\n   50,\n   10,\n   30,\n   15,\n   80,\n   100,\n   600,\n   60,\n   21,\n   10,\n   20,\n   10,\n   15,\n   18,\n   10,\n   10,\n   10],\n  [10,\n   9,\n   16,\n   16,\n   60,\n   16,\n   80,\n   9,\n   10,\n   10,\n   160,\n   10,\n   200,\n   120,\n   10,\n   230,\n   19,\n   16,\n   50,\n   18,\n   10,\n   10,\n   0,\n   9,\n   10,\n   170,\n   21,\n   18,\n   13,\n   10,\n   10,\n   10,\n   16,\n   8,\n   8,\n   8,\n   600,\n   150,\n   8,\n   8,\n   190,\n   8,\n   70,\n   10,\n   10,\n   20,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   250,\n   10,\n   10,\n   200,\n   100,\n   10,\n   118,\n   10,\n   10,\n   10,\n   9,\n   10,\n   10,\n   10,\n   200,\n   8,\n   15,\n   10,\n   10,\n   10,\n   18,\n   8,\n   10,\n   10,\n   8,\n   40,\n   10,\n   8,\n   10,\n   12,\n   8,\n   10,\n   10,\n   9,\n   15,\n   15,\n   14,\n   10,\n   200,\n   8,\n   10,\n   10,\n   110,\n   10,\n   10,\n   10,\n   20,\n   15,\n   10],\n  [80,\n   50,\n   15,\n   140,\n   8,\n   450,\n   10,\n   20,\n   20,\n   20,\n   320,\n   10,\n   10,\n   20,\n   20,\n   25,\n   10,\n   10,\n   10,\n   9,\n   10,\n   26,\n   10,\n   10,\n   10,\n   430,\n   10,\n   10,\n   20,\n   20,\n   20,\n   130,\n   10,\n   23,\n   10,\n   100,\n   10,\n   9,\n   10,\n   20,\n   18,\n   10,\n   19,\n   10,\n   27,\n   17,\n   130,\n   20,\n   10,\n   19,\n   14,\n   18,\n   15,\n   50,\n   10,\n   15,\n   25,\n   10,\n   10,\n   10,\n   20,\n   13],\n  [10,\n   10,\n   10,\n   10,\n   10,\n   30,\n   20,\n   100,\n   10,\n   10,\n   10,\n   17,\n   10,\n   400,\n   10,\n   80,\n   550,\n   10,\n   8,\n   10,\n   8,\n   12,\n   70,\n   9,\n   10,\n   10,\n   10,\n   20,\n   180,\n   20,\n   19,\n   10,\n   10,\n   40,\n   18,\n   50,\n   10,\n   20,\n   90,\n   17,\n   10,\n   10,\n   15,\n   15,\n   8,\n   10,\n   130,\n   10,\n   13,\n   20,\n   60,\n   8,\n   9,\n   20,\n   10,\n   210,\n   9,\n   9,\n   20,\n   10,\n   150,\n   10,\n   13,\n   17],\n  [10,\n   20,\n   10,\n   15,\n   10,\n   10,\n   15,\n   10,\n   40,\n   220,\n   15,\n   470,\n   520,\n   10,\n   9,\n   22,\n   10,\n   10,\n   10,\n   12,\n   10,\n   580,\n   10,\n   8,\n   10,\n   10,\n   10,\n   50,\n   18,\n   10,\n   10,\n   10,\n   8,\n   10,\n   20,\n   10,\n   10,\n   10,\n   10,\n   10,\n   220,\n   27,\n   10,\n   10,\n   10,\n   60,\n   10,\n   11,\n   10,\n   50,\n   10,\n   13,\n   90,\n   11,\n   23,\n   120,\n   460,\n   250,\n   8,\n   100,\n   10,\n   200,\n   9,\n   10,\n   190,\n   590,\n   15,\n   16,\n   50,\n   10,\n   590,\n   40,\n   119,\n   10,\n   16,\n   600,\n   10,\n   10,\n   10,\n   9],\n  [10,\n   10,\n   160,\n   14,\n   10,\n   110,\n   10,\n   10,\n   10,\n   11,\n   150,\n   24,\n   190,\n   20,\n   24,\n   50,\n   20,\n   80,\n   170,\n   8,\n   9,\n   17,\n   16,\n   60,\n   10,\n   10,\n   10,\n   10,\n   160,\n   10,\n   10,\n   10,\n   8,\n   10,\n   10,\n   10,\n   10,\n   16,\n   10,\n   10,\n   100,\n   13,\n   50,\n   10,\n   12,\n   8,\n   22,\n   70,\n   20,\n   10,\n   24,\n   10,\n   21,\n   10,\n   14,\n   11,\n   12,\n   140,\n   10,\n   10,\n   10,\n   17],\n  [20,\n   36,\n   550,\n   10,\n   10,\n   10,\n   22,\n   16,\n   20,\n   10,\n   10,\n   25,\n   10,\n   70,\n   20,\n   16,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   100,\n   10,\n   8,\n   10,\n   140,\n   10,\n   10,\n   11,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   25,\n   10,\n   8,\n   10,\n   8,\n   10,\n   10,\n   10,\n   10,\n   10,\n   20,\n   25,\n   11,\n   10,\n   20,\n   14,\n   20,\n   12,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   14,\n   180,\n   30,\n   12,\n   13,\n   10,\n   9,\n   10,\n   10,\n   9,\n   19,\n   20,\n   400,\n   10,\n   8,\n   10,\n   10,\n   14,\n   10,\n   10,\n   260,\n   530,\n   10,\n   25,\n   10,\n   10,\n   10,\n   26,\n   40,\n   15,\n   15,\n   40,\n   50,\n   50,\n   50,\n   10,\n   10,\n   10,\n   25,\n   21,\n   10,\n   92,\n   10,\n   10,\n   24,\n   120,\n   30,\n   10,\n   20,\n   10,\n   10,\n   100,\n   11,\n   20,\n   30,\n   10,\n   15,\n   10,\n   14],\n  [15,\n   21,\n   100,\n   28,\n   10,\n   10,\n   10,\n   10,\n   20,\n   10,\n   10,\n   18,\n   17,\n   20,\n   10,\n   10,\n   13,\n   17,\n   10,\n   120,\n   10,\n   80,\n   600,\n   15,\n   30,\n   70,\n   10,\n   18,\n   310,\n   10,\n   10,\n   60,\n   10,\n   10,\n   420,\n   20,\n   20,\n   15,\n   50,\n   10,\n   10,\n   30,\n   100,\n   10,\n   60,\n   10,\n   10,\n   10,\n   10,\n   10,\n   8,\n   10,\n   10,\n   12,\n   11,\n   11,\n   10,\n   10,\n   10,\n   40,\n   14,\n   8,\n   10,\n   20,\n   20],\n  [10,\n   8,\n   50,\n   10,\n   12,\n   15,\n   10,\n   10,\n   10,\n   30,\n   10,\n   10,\n   10,\n   20,\n   10,\n   13,\n   17,\n   142,\n   11,\n   10,\n   10,\n   25,\n   14,\n   10,\n   8,\n   20,\n   12,\n   8,\n   100,\n   9,\n   8,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   10,\n   80,\n   550,\n   10,\n   17,\n   11,\n   8,\n   9,\n   10,\n   80,\n   22,\n   280,\n   10,\n   270,\n   40,\n   100,\n   22,\n   10,\n   60,\n   8,\n   50,\n   50,\n   16,\n   10,\n   30,\n   50,\n   75,\n   10,\n   136,\n   50,\n   50,\n   50,\n   10,\n   40,\n   40,\n   40,\n   40,\n   40,\n   100,\n   10,\n   10,\n   10,\n   10,\n   11,\n   10,\n   9,\n   8,\n   8]]}"
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "month_group = df[['month', '深度(千米)']].groupby('month')\n",
    "name = [int(i[0]) for i in month_group]\n",
    "value = [[int(j[1]) for j in i[1].values] for i in month_group]\n",
    "{\n",
    "    'name': name,\n",
    "    'value': value\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-19T12:36:13.735497600Z",
     "start_time": "2024-05-19T12:36:13.601272900Z"
    }
   },
   "id": "4556fdf54f815086"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
